/**
 * @param {number[]} nums
 * @return {number}
 */
var distinctAverages = function (nums) {
  let set = new Set()
  nums.sort((a,b)=>a-b)
  for(let i=0,j=nums.length-1;i<j;i++,j--){
    set.add((nums[i]+nums[j]))
  }

  return set.size
};